﻿@model DirectPaymentModel
@{ ViewBag.Title = "Confirm Payment Details"; }
<p>Please confirm the following payment details. Your credit card will be charged after completing this step.</p>
<div>
    <fieldset>
        <legend>Order Details</legend>
        <table class="cart wide" style="margin-top: 12px; margin-bottom: 0px;">
            <thead>
                <tr>
                    <th>Item</th>
                    <th>Description</th>
                    <th>Price</th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <td></td>
                    <td style="text-align: right;">Total:</td>
                    <td>@String.Format("{0:c}", Cart.Current.TotalCost)</td>
                </tr>
            </tfoot>
            <tbody>
                @foreach (var buyable in Cart.Current.ProductEntityItems())
                {
                    <tr>
                        <td>@buyable.LinkToItem(Html, buyable.Title)</td>
                        <td class="markup">@Html.Raw(buyable.Teaser)</td>
                        <td>@buyable.PriceString()</td>
                    </tr>
                }
            </tbody>
        </table>
    </fieldset>

    <fieldset class="confirmPayment">
        <legend>Payment Details</legend>
        <p style="margin-top: 12px;">
            <label>Name:</label> @Model.FirstName @Model.LastName <br />
            <label>Card:</label> @Model.CardType, @Model.ObfuscateCardNumber() <br />
            <label>Expires:</label> @Model.ExpirationMonth/@Model.ExpirationYear <br />
        </p>
        <p class="billing">
            <label>Billing Address:</label>
            <br />
            @Model.BillingAddress1
            @if (!String.IsNullOrWhiteSpace(Model.BillingAddress2))
            {
                <text><br />@Model.BillingAddress2</text>
            }
            <br />
            @Model.City, @Model.State @Model.ZipCode
            <br />
            @Model.Country
        </p>
        <h3 style="margin-bottom: 0px;">Total Amount: @Cart.Current.TotalCostString</h3>
    </fieldset>
    @using (Html.BeginForm("DoDirectPayment", "Cart", FormMethod.Post))
    {
        <p>
            <input type="submit" value="Complete Payment" /> @Html.ActionLink("Cancel Payment", "CancelPayment", null, new { @class = "cancelLink", onclick = "return confirm('Are you sure you wish to cancel this order?')" })
        </p>
    }
</div>
